package fts.ftsmonitoring.ftsTaggers;


import java.io.File;
import java.util.ArrayList;

import fts.ftsmonitoring.ftsTaggers.IAutoTagger;


public class FileSizeTagger implements IAutoTagger
{

	public String getDescription()
	{
		return "Tags files by file size";
	}

	public ArrayList<String> getTags(String fileName)
	{
		ArrayList<String> res = new ArrayList<String>();
		try
		{
			File f = new File(fileName);
			if (f.exists())
			{
				long mbLength = f.length() / 1024 / 1024;
				if(mbLength < 5)
				{
					res.add("small");
				}
				else if(mbLength < 10)
				{
					res.add("medium");
				}
				else if(mbLength < 100)
				{
					res.add("large");
				}
				else
				{
					res.add("xlarge");
				}
			}
		}
		catch(Exception ex)
		{
			
		}
		return res;
	}

}
